package com.example.demospringboot.netty.http;

import com.example.demospringboot.netty.http.service.HttpService;
import com.example.demospringboot.netty.http.service.impl.HttpServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author chenlei
 * @date 2020/1/8
 * @description
 **/
@Configuration
@EnableConfigurationProperties(HttpProperties.class)
public class HttpConfig {

    @Autowired
    private HttpProperties httpProperties;

    @Bean
    public HttpService httpService(){
        return new HttpServiceImpl(httpProperties);
    }

}
